

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>查看此贴</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="keywords" content="fly,layui,前端社区">
  <meta name="description" content="Fly社区是模块化前端UI框架Layui的官网社区，致力于为web开发提供强劲动力">
  <link rel="stylesheet" href="/static/res/layui/css/layui.css">
  <link rel="stylesheet" href="/static/res/css/global.css">
</head>
<body>

<div class="fly-header layui-bg-black">
  <div class="layui-container">
    <a class="fly-logo" href="/">
      <img src="/static/res/images/logo.png" alt="layui">
    </a>


    <ul class="layui-nav fly-nav-user">
            {% if not user_id %}
                <!-- 未登入的状态 -->
                <li class="layui-nav-item">
                    <a class="iconfont icon-touxiang layui-hide-xs" href="passport/login"></a>
                </li>
                <li class="layui-nav-item">
                    <a href="/passport/login">登入</a>
                </li>
                <li class="layui-nav-item">
                    <a href="/passport/reg">注册</a>
                </li>
                <!-- 登入后的状态 -->
            {% else %}
                <li class="layui-nav-item">
                    <a class="fly-nav-avatar" href="javascript:;">
                        <cite class="layui-hide-xs">{{ user.nick_name }}</cite>
                        {% if not user.credentials %}
                            {#                <i class="iconfont icon-renzheng layui-hide-xs" title="认证信息：{{ user.credentials }}"></i>#}
                        {% else %}
                            <i class="iconfont icon-renzheng layui-hide-xs" title="认证信息：{{ user.credentials }}"></i>
                        {% endif %}
                        {% if user.vip_leven ==0 %}
                            {#                    <i class="layui-badge fly-badge-vip layui-hide-xs">VIP{{ user.vip_leven }}</i>#}
                        {% else %}
                            <i class="layui-badge fly-badge-vip layui-hide-xs">VIP{{ user.vip_leven }}</i>
                        {% endif %}
                        <img src="{{ user.avatar_url }}">
                    </a>
                    <dl class="layui-nav-child">
                        <dd><a href="/user/set"><i class="layui-icon">&#xe620;</i>基本设置</a></dd>
{#                        <dd><a href="/user/message"><i class="iconfont icon-tongzhi" style="top: 4px;"></i>我的消息</a>#}
{#                        </dd>#}
                        <dd><a href="/user/home"><i class="layui-icon" style="margin-left: 2px; font-size: 22px;">&#xe68e;</i>我的主页</a>
                        </dd>
                        <hr style="margin: 5px 0;">
                        <dd><a href="/passport/logout" style="text-align: center;">退出</a></dd>
                    </dl>
                </li>
            {% endif %}
        </ul>
  </div>
</div>

<div class="layui-hide-xs">
  <div class="fly-panel fly-column">
    <div class="layui-container">
      <ul class="layui-clear">
        <li class="layui-hide-xs"><a href="/">首页</a></li>
        <li ><a href="">提问</a></li>
        <li><a href="">分享</a></li>
        <li><a href="">讨论</a></li>
        <li><a href="">建议</a></li>
        <li><a href="">公告</a></li>
        <li><a href="">动态</a></li>
        <li class="layui-hide-xs layui-hide-sm layui-show-md-inline-block"><span class="fly-mid"></span></li>

        <!-- 用户登入后显示 -->
        <li class="layui-hide-xs layui-hide-sm layui-show-md-inline-block"><a href="/user/index">我发表的贴</a></li>
{#        <li class="layui-hide-xs layui-hide-sm layui-show-md-inline-block"><a href="/user/index#collection">我收藏的贴</a></li>#}
{#      </ul>#}

      <div class="fly-column-right layui-hide-xs">
{#        <span class="fly-search"><i class="layui-icon"></i></span>#}
        <a href="/jie/add" class="layui-btn">发表新帖</a>
      </div>
      <div class="layui-hide-sm layui-show-xs-block" style="margin-top: -10px; padding-bottom: 10px; text-align: center;">
        <a href="/jie/add" class="layui-btn">发表新帖</a>
      </div>
    </div>
  </div>
</div>

<div class="layui-container">
  <div class="layui-row layui-col-space15">
    <div class="layui-col-md8 content detail">
      <div class="fly-panel detail-box">
        <h1>{{post.title}}</h1>
        <div class="fly-detail-info">
          <!-- <span class="layui-badge">审核中</span> -->
{#            {% if not status.dynamic %}#}
{#             <span class="layui-badge layui-bg-green fly-detail-column">动态</span>#}
{#            {% else %}#}
             <span class="layui-badge layui-bg-green fly-detail-column">{{ post.category.name }}</span>
{#            {% endif %}#}
          {% if post.unfinished %}
          <span class="layui-badge" style="background-color: #999;">未结</span>
          {% else %}
          <span class="layui-badge" style="background-color: #999;">未结</span>
          {% endif %}
          <!-- <span class="layui-badge" style="background-color: #5FB878;">已结</span> -->
          {% if not post.top %}
{#          <span class="layui-badge layui-bg-black">置顶</span>#}
          {% else %}
           <span class="layui-badge layui-bg-black">置顶</span>
          {% endif %}
           {% if not post.best %}
{#          <span class="layui-badge layui-bg-red">精帖</span>#}
          {% else %}
          <span class="layui-badge layui-bg-red">精帖</span>
          {% endif %}
          <div class="fly-admin-box" data-id="{{ post.id }}">
            <span class="layui-btn layui-btn-xs jie-admin" type="del">删除</span>

            <span class="layui-btn layui-btn-xs jie-admin" type="set" field="stick" rank="1">置顶</span>
            <!-- <span class="layui-btn layui-btn-xs jie-admin" type="set" field="stick" rank="0" style="background-color:#ccc;">取消置顶</span> -->

            <span class="layui-btn layui-btn-xs jie-admin" type="set" field="status" rank="2">加精</span>
            <!-- <span class="layui-btn layui-btn-xs jie-admin" type="set" field="status" rank="0" style="background-color:#ccc;">取消加精</span> -->
          </div>
          <span class="fly-list-nums">
            <a href="#comment"><i class="iconfont" title="回答">&#xe60c;</i> {{ post.comments.count() }}</a>
            <i class="iconfont" title="人气">&#xe60b;</i> {{ post.clicks }}
          </span>
        </div>
        <div class="detail-about">
          <a class="fly-avatar" href="../user/home.html">
            <img src="{{ post.user.avatar_url }}" alt="贤心">
          </a>
          <div class="fly-detail-user">
            <a href="../user/home.html" class="fly-link">
              <cite>{{post.user.nick_name}}</cite>
              <i class="iconfont icon-renzheng" title="认证信息：{{ post.user.credentials }}"></i>
              <i class="layui-badge fly-badge-vip">VIP{{ post.user.vip_leven }}</i>
            </a>
            <span>{{ post.create_time }}</span>
          </div>
          <div class="detail-hits" id="LAY_jieAdmin" data-id="123">
            <span style="padding-right: 10px; color: #FF7200">悬赏：{{ post.fly_kiss }}飞吻</span>
            <span class="layui-btn layui-btn-xs jie-admin" type="edit"><a href="add.html">编辑此贴</a></span>
          </div>
        </div>
        <div class="detail-body photos">
            {{ post.content |safe}}
        </div>
      </div>

      <div class="fly-panel detail-box" id="flyReply">
        <fieldset class="layui-elem-field layui-field-title" style="text-align: center;">
          <legend>回帖</legend>
        </fieldset>

        <ul class="jieda" id="jieda">
            {% for comment in post.comments %}
          <li data-id="{{ comment.id }}" class="jieda-daan">
            <a name="item-1111111111"></a>
            <div class="detail-about detail-about-reply">
              <a class="fly-avatar" href="">
                <img src="{{ comment.user.avatar_url }}" alt=" ">
              </a>
              <div class="fly-detail-user">
                <a href="" class="fly-link">
                  <cite>{{ comment.user.nick_name }}</cite>
                  <i class="iconfont icon-renzheng" title="认证信息：XXX"></i>
                  <i class="layui-badge fly-badge-vip">VIP{{ comment.user.vip_leven }}</i>
                </a>

{#                <span>(楼主)</span>#}
              </div>

              <div class="detail-hits">
                <span>{{ comment.create_time }}</span>
              </div>

{#              <i class="iconfont icon-caina" title="最佳答案"></i>#}
            </div>
            <div class="detail-body jieda-body photos">
              <p>{{ comment.content  }}</p>
            </div>
            <div class="jieda-reply">
               {% if comment in like_comment %}
              <span class="jieda-zan zanok" type="zan"><i class="iconfont icon-zan"></i><em>{{ comment.like_user.count() }}</em></span>
                {% else %}
              <span class="jieda-zan " type="zan"><i class="iconfont icon-zan"></i><em>{{ comment.like_user.count() }}</em></span>
                {% endif %}
              <span type="reply">
                <i class="iconfont icon-svgmoban53"></i>
                回复
              </span>
{#              <div class="jieda-admin">#}
{#                <span type="edit">编辑</span>#}
{#                <span type="del">删除</span>#}
{#                <!-- <span class="jieda-accept" type="accept">采纳</span> -->#}
{#              </div>#}
            </div>
          </li>
            {% endfor %}

          <!-- 无数据时 -->
          <!-- <li class="fly-none">消灭零回复</li> -->
        </ul>

        <div class="layui-form layui-form-pane">
          <form action="/jie/comment" method="post" class="comment_form">
            <div class="layui-form-item layui-form-text">
              <a name="comment"></a>
              <div class="layui-input-block">
                <textarea id="L_content" name="content" required lay-verify="required" placeholder="请输入内容"  class="layui-textarea fly-editor" style="height: 150px;"></textarea>
              </div>
            </div>
            <div class="layui-form-item">
              <input type="hidden" name="pid" value="{{ post.id }}" data-post-id="{{ post.id }}">
              <button class="layui-btn" lay-filter="*" lay-submit>提交回复</button>
            </div>
          </form>
        </div>
      </div>
    </div>
    <div class="layui-col-md4">
      <dl class="fly-panel fly-list-one">
                <dt class="fly-panel-title">本周最新</dt>
                {% for post_hot in time_Rank %}
                    <dd>
                        <a href="/detail/{{ post_hot.id }}">{{ post_hot.title }}</a>
{#                        <span><i class="iconfont icon-pinglun1"></i> {{ post_hot.comments.count() }}</span>#}
                    </dd>
                {% endfor %}
            </dl>

    </div>
  </div>
</div>

<div class="fly-footer">
  <p><a href="#" target="_blank">Flask项目</a> 2020 &copy; <a href="#" target="_blank">zqy出品</a></p>
</div>

<script src="/static/jquery-1.12.4.min.js"></script>
<script src="/static/jquery.form.min.js"></script>
<script src="/static/jquery.pagination.min.js"></script>
<script src="/static/res/layui/layui.js"></script>
{#<script src="/static/detail.js"></script>#}

<script>
    layui.cache.page = 'jie';
    layui.cache.user = {
      username: '游客'
      ,uid: -1
      ,avatar: '/static/res/images/avatar/00.jpg'
      ,experience: 83
      ,sex: '男'
    };
    layui.config({
      version: "3.0.0"
      ,base: '/static/res/mods/'
    }).extend({
      fly: 'index'
    }).use(['fly', 'face'], function(){
      var $ = layui.$
      ,fly = layui.fly;
      //如果你是采用模版自带的编辑器，你需要开启以下语句来解析。
      /*
      $('.detail-body').each(function(){
        var othis = $(this), html = othis.html();
        othis.html(fly.content(html));
      });
      */
    });
</script>

</body>
</html>